import React, { useCallback } from "react";

import ForKeysCom from "./components/ForKeysCom";
import mockData from "./mockJson.json";

const StickyScroll = () => {
  const moreForKeysCom = useCallback((data) => {
    const keys = Object.keys(data);
    return keys.map((item) => (
      <ForKeysCom item={data[item]} myKey={item} key={item} />
    ));
  }, []);

  return <React.Fragment>{moreForKeysCom(mockData)}</React.Fragment>;
};

export default StickyScroll;
